home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
E-Education
/
(c)e8.d64
/
lemonade stand.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
5KB
|
188 lines
10 POKE53280,8:POKE53281,8
20 PRINT"[147][142][158] [165] [207][167][205][206][165][206][205][167][205] [165][206][205] [207][205] [207] [207] [183][207] [206][205][167][205] [165][207][205]
21 [153]" (null) (null)THEN FN(null)(null)THEN (null)FN(null)(null) (null)(null) (null) (null) FN (null)(null)THEN (null)FN(null)(null)
22 PRINT" [163] [163] [163]
25 [153],"VERIFYCOMMODORE 64 VERSION
30 PRINT," BY
35 [153],"SYSSTEVEN DARNOLD
40 PRINT,"P.O. BOX 201
45 [153],"ALEXANDRA, NEW ZEALAND
100 FORI=1TO6000:NEXT:PRINTCHR$(14);:T=RND(-TI)
102 GOTO1300
104 INPUT"[142][149]YOUR NAME";A$
106 A$=LEFT$(A$,13)
110 B=10
115 FORX=1TO10:GOSUB997 :GOSUB1500
116 PRINT""X;
118 PRINT"[158]PREDICTION FOR[157][157][157][157][157][157][157][157][157][157][157][157][157][157]SATURDAY:";
120 PRINT"[157][157][157][157][157][157][157][157][157]TEMPERATURE [157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]ABOUT"T"[157]."
124 GOSUB1800
127 GOSUB1700
128 PRINT"SUGAR IS $"S"FOR A 5-POUND BAG"
130 PRINT"[145][149]HOW MANY BAGS DO YOU WANT TO BUY? ";:GOSUB60000:A=VAL(X$)
134 IFA*S<BGOTO140
136 GOSUB1700:PRINT"YOU DON'T HAVE ENOUGH MONEY FOR"A"BAGS"
138 FORY=1TO3000:NEXT
139 GOTO127
140 B=B-(A*S):A1=A1+(5*A)
145 GOSUB1800
150 GOSUB1700
158 PRINT"CONCENTRATED LEMON JUICE IS $"L"A LTR."
160 PRINT"[145][149]HOW MANY BOTTLES DO YOU WANT TO BUY? ";:GOSUB60000:D=VAL(X$)
164 IFD*L<BGOTO170
166 GOSUB1700:PRINT"YOU DON'T HAVE ENOUGH MONEY FOR"D"LTRS
168 [129]Y[178]1[164]3000:[130]
169 [137]150
170 B[178]B[171](D[172]L):D1[178]D1[170]D
175 [141]1800
180 [141]1700
188 [153]"CUPS ARE $"C"FOR A BAG OF 100"
190 [153]"ONVERIFYHOW MANY BAGS DO YOU WANT TO BUY? ";:[141]60000:P[178][197](X$)
194 [139]P[172]C[179]B[137]200
196 [141]1700:[153]"YOU DON'T HAVE ENOUGH MONEY FOR"P"BAGS"
198 [129]Y[178]1[164]3000:[130]
199 [137]180
200 B[178]B[171](P[172]C):P1[178]P1[170](P[172]100)
202 [141]1800
204 [141]1700
218 [153]"";
220 [129]V[178]1[164]8
224 [153][163]23)" "
226 [130]V
228 [153]""[163]23)"TEMPERATURE:"Z[170]T
245 [153]"PRICE (IN CENTS) FOR A CUP OF LEMONADE ";
247 [141]60000
248 K[178][197](X$):K[178][181](K):[139]K[179]1[167]202
249 [141]1700
250 F3[178]Z[170]T[171]11[170][181]([187](1)[172]5)
254 [153]""K
260 F1[178](F3[171]K)[172]F3
262 [139]F1[179]0[167]F1[178]0
263 [139]F1[179]1[167]W[178]1:[137]290
264 [141]800
265 [139]W[178]F1[137]300
266 [139]P1[177]0[137]271
267 [141]1700
268 [153]"YOU WOULD HAVE MADE"F1"SALES, IF YOU":[153]"ONHAD MORE CUPS."
270 [129]Y[178]1[164]3000:[130]
271 [141]1700
275 [139]D1[177]0[137]280
277 [153]"YOU WOULD HAVE MADE"F1"SALES, IF YOU":[153]"ONHAD MORE LEMON JUICE."
279 [129]Y[178]1[164]3000:[130]
280 [141]1700
285 [139]A1[177]0[137]290
287 [153]"YOU WOULD HAVE MADE"F1"SALES, IF YOU":[153]"ONHAD MORE SUGAR."
289 [129]Y[178]1[164]3000:[130]
290 [141]1700
300 [153]"YOU MADE"W[171]1"SALES AT"K"CENTS A CUP."
301 [153]"ONYOU GROSSED $"(W[171]1)[172](K[173]100)" PRESS SHIFT
305 WAIT 653,1
308 K1=INT(.5*F3)
315 G5=INT((F3-K1)*F3)*(K1/100)
325 G9=G5
330 K9=K1
343 GOSUB1700
344 IFK=K9THENPRINT"WELL DONE! YOU CHOSE THE BEST PRICE.":GOTO375
345 PRINT"YOU COULD HAVE GROSSED $"G9"TODAY"
346 PRINT"[145]IF YOU HAD CHARGED"K9"CENTS"
375 K9=0:G9=0
376 PRINT"PRESS SHIFT TO CONTINUE"
377 WAIT653,1,1:WAIT653,1
400 NEXTX
405 PRINT"[147]THE SUMMER IS OVER."
410 PRINT"[149]YOU HAVE $"BB
415 PRINT"YOU OWE YOUR FAMILY $ 10, SO YOU EARNED $"BB-10" THIS SUMMER."
420 PRINT"[149]YOU HAVE"P1"CUPS,"INT(D1)"BOTTLES OF LEMON
421 [153]"JUICE AND"[181](A1)"POUNDS OF SUGAR LEFT OVER.
430 END
800 FORW=1TOF1
827 IFP1<.5THENP1=0
828 IFD1<.5THEND1=0
829 IFA1<.5THENA1=0
830 IFP1=0ORA1=0ORD1=0THENGOTO847
833 GOSUB1800
834 D1=D1-(1/40)
835 A1=A1-(1/20)
836 P1=P1-1
837 B=B+(K*.01)
845 NEXTW
847 GOSUB1800
850 RETURN
997 PRINT"[147]WEEK NUMBER"N
1000 PRINT"
1010 [153]" YOU HAVE:
1020 PRINT" $
1030 [153]"VERIFY THENUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRUSRFN LTRS LEM
1040 PRINT"[149] [167] [165] LBS SUGAR
1045 [153]"ON"A$"'S"
1050 [153]"VERIFY THEN LEMONADE VERIFY FN CUPS
1060 PRINT"[149] [167] [165]
1070 [153]" THEN CENTS VERIFY FN SYSWEATHER:
1080 PRINT"[149] [167][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][165]
1090 [153]" THENSYS TOTOTO VERIFY FN
1100 PRINT" [167][158] [205] [206][201][149] [165]
1110 [153]" THENSYS ( )(null)LISTGETGETGETGETGETGETGETGETGETVERIFY FN
1130 PRINT" [167][169] [223][146][165]
1140 [153]" STEP (null)WAIT
1150 PRINT" [200]([217]@[199]()[213][201][199]()[199])[199]*[199]
1160 [153]" LEFT$)(null)(PEEK)(MID$(null)PEEK)(PEEK@CHR$)CHR$
1170 PRINT" [200]([217])[199]([215]()[199](*[199])[199]([199]
1180 [153]" LEFT$)(null)(PEEK)(@(PEEK)(PEEK(CHR$)CHR$
1190 PRINT" [200]*[217])[199]*)()[199]()[199])[199]([199]
1200 [153]" LEFT$)(null)(PEEK)()(PEEK)(PEEK(CHR$)CHR$
1210 PRINT"[177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177][177]
1220 [142]
1300 [153]"LOAD"
1301 [153]"(null)OU'VE DECIDED TO RUN A LEMONADE STAND"
1302 [153]"FOR TEN SATURDAYS THIS SUMMER IN ORDER"
1304 [153]"TO MAKE SOME MONEY.":[153]
1306 [153]"PEEKUT YOU SOON FIND THAT RUNNING A STAND"
1308 [153]"COSTS MONEY.":[153]
1310 [153]"(null)OUR JOB IS TO MAKE AS BIG A PROFIT AS ":[153]"YOU CAN.":[153]
1312 [153]"(null)OUR FAMILY AGREES TO STAKE YOU TOCLOSE$10"
1314 [153]"IN ORDER TO GET STARTED. ATNT THE END OF"
1316 [153]"THE SUMMER YOU WILL HAVE TO RETURN THE"
1318 [153]"$10, BUT YOU WILL NOT NEED TO PAY"
1320 [153]"INTEREST.":[153]
1322 [141]1400
1324 [153]"LOAD"
1326 [153]"LEFT$RIGHT$(null)(null)(null):SYS"
1328 [153]"RIGHT$F YOU KEEP YOUR PRICE LOW, YOU'LL SELL"
1330 [153]"MORE LEMONADE, BUT YOU WILL MAKE LESS"
1332 [153]"MONEY ON EACH SALE.":[153]
1334 [153]"(null)N HOT DAYS, YOU WILL SELLCLOSEMORE LEMONADE
1336 PRINT"[145]AND[160]ALSO[160]YOU[160]WILL[160]BE[160]ABLE TO CHARGE MORE
1338 [153]"ONPER CUP."
1344 [141]1400
1346 [153]"RETURNLOAD";
1350 [137]104
1400 [153]:[153]"VERIFY(null)RESS (null)LEFT$RIGHT$ASC(null)WAITONCMDCMDCMDCMDCMDTOTOTOTOTOVERIFY TO CONTINUE.SYS"
1404 [146]653,1,1:[146]653,1:[142]
1500 T[178][181]([187](1)[172]15[170]19)
1514 S[178].99[170](.01)[172][181]([187](1)[172]9):[143]**COST OF SUGAR
1516 L[178].69[170](.01)[172][181]([187](1)[172]9):[143]**COST OF CONCENTRATE
1518 C[178].90[170](.01)[172][181]([187](1)[172]9):[143]**COST OF CUPS
1520 Z[178][171]4[170][181]([187](1)[172]9)
1600 [142]
1700 [153]" "
1702 [153]" "
1704 [153]"";
1705 [142]
1800 [129]U[178]1[164]6
1802 [139][202]([196](B),U,1)[178]"."[137]1807
1803 [130]U
1805 BB[178]B:[137]1808
1807 BB[178][197]([200]([196](B),U[170]2)):BB[178][181](100[172]BB)[173]100
1808 [153]""[163]25)" CMDCMDCMDCMDCMDCMD"BB
1809 [153][163]25)" CMDCMDCMDCMDCMD"[181](D1)
1810 [153][163]25)" CMDCMDCMDCMDCMD"[181](A1)
1811 [153][163]25)" CMDCMDCMDCMDCMD"P1
1815 [142]
60000 X$[178]"":[151]198,0:[151]204,0:[153]" CMDCMDCMD";
60010 [146]198,7:[161]Z$:ZZ[178][198](Z$):[139]ZZ[177]57[167]60010
60080 ZL[178][195](X$):[139]ZL[177]2[167]60110
60100 [139]ZZ[177]47[167]X$[178]X$[170]Z$:[153]Z$;:[137]60010
60110 [139]ZZ[178]13[175]ZL[167][151]204,1:[153]" ";:[142]
60120 [139]ZZ[178]20[175]ZL[167]X$[178][200](X$,ZL[171]1):[153]Z$;
60140 [137]60010